﻿CREATE PROCEDURE [dbo].[proc_AppFunction_GetList]
	(
		@CId int,
		@Stext nvarchar(50),
		@StartIndex int,
		@EndIndex int
	)
AS
	;WITH list As(Select ROW_NUMBER() OVER (ORDER BY Sort)AS Row,
	Id,
	CId,
	AName,
	(Select CName From AppController Where Id=AppAction.CId) As CName,
	Title,
	Description,
	IsView,
	CreateTime,
	Sort 
	From AppAction Where (@CId=0 Or CId=@CId) and (@Stext is null Or AName like '%'+@Stext+'%')
	)
	Select * From list Where Row between @StartIndex and @EndIndex
	RETURN
